package structural.decorator;

public class Test {

    public static void main(String[] args) {
        SimpleFighter pSimpleFighter = new SimpleFighter();
        pSimpleFighter.fight();
        System.out.println("");
        SuperFighterWithGun pSuperFighterWithGun = new SuperFighterWithGun(pSimpleFighter);
        pSuperFighterWithGun.fight();
        System.out.println("");
        SuperFighterWithKnife pSuperFighterWithKnife = new SuperFighterWithKnife(pSuperFighterWithGun);
        pSuperFighterWithKnife.fight();
        System.out.println("");

        //其实只有这种使用方式才是正确的，因为他们都是格斗家，不应该限制成具体的类型
        IFighter pCommonFighter = new SuperFighterWithKnife(pSuperFighterWithGun);
        pCommonFighter.fight();
    }

}
